package com.ssyt.ssh.sys.dao.impl;


import java.util.List;

import org.springframework.stereotype.Repository;

import com.ssyt.ssh.common.BaseDao;
import com.ssyt.ssh.common.PageModel;
import com.ssyt.ssh.sys.dao.UserDao;
import com.ssyt.ssh.sys.entity.User;

@Repository
public class UserDaoImpl extends BaseDao<User, Integer> implements UserDao {

	@Override
	public Integer add(User user) {
		return save(user);
	}

	public void query() {
		 PageModel<Object[]> pageMultiPropertyBySql = pageMultiPropertyByHql("SELECT u.id,u.username,l.context FROM User u,Log l WHERE u.id=l.userId",1,3 );
		 List<Object[]> list = pageMultiPropertyBySql.getList();
		 for (Object[] objects : list) {
			 System.out.println(objects[0]+","+objects[1]+","+objects[2]);
		}
			
	}

}
